{"ast":null,"code":"var _jsxFileName = \"/data/messenger.client/src/components/Modal/index.tsx\";\nimport React from 'react';\nimport ReactDOM from \"react-dom\";\nimport \"./Modal.scss\";\nimport { Button } from \"../index\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nimport { Fragment as _Fragment } from \"react/jsx-dev-runtime\";\nconst Modal = _ref => {\n  let {\n    active,\n    title,\n    hasFunctionButtons = false,\n    onSubmit,\n    onClose,\n    children\n  } = _ref;\n  if (active) {\n    const portalElement = document.getElementById('root');\n    if (portalElement) {\n      return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/_jsxDEV(\"div\", {\n        className: \"modal\",\n        onClick: onClose,\n        children: /*#__PURE__*/_jsxDEV(\"div\", {\n          className: \"modal__content\",\n          onClick: event => event.stopPropagation(),\n          children: [/*#__PURE__*/_jsxDEV(\"div\", {\n            className: \"modal__header\",\n            children: /*#__PURE__*/_jsxDEV(\"div\", {\n              className: \"modal__title\",\n              children: title\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 15,\n              columnNumber: 29\n            }, this)\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 14,\n            columnNumber: 25\n          }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n            className: \"modal__body\",\n            children: children\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 17,\n            columnNumber: 25\n          }, this), hasFunctionButtons && /*#__PURE__*/_jsxDEV(\"div\", {\n            className: \"modal__footer\",\n            children: [/*#__PURE__*/_jsxDEV(Button, {\n              fullWidth: false,\n              text: 'Отмена',\n              customClassName: \"modal__button\",\n              callback: onClose\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 20,\n              columnNumber: 33\n            }, this), /*#__PURE__*/_jsxDEV(Button, {\n              fullWidth: false,\n              text: 'Подтвердить',\n              customClassName: \"modal__button\"\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 26,\n              columnNumber: 33\n            }, this)]\n          }, void 0, true, {\n            fileName: _jsxFileName,\n            lineNumber: 19,\n            columnNumber: 29\n          }, this)]\n        }, void 0, true, {\n          fileName: _jsxFileName,\n          lineNumber: 13,\n          columnNumber: 21\n        }, this)\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 12,\n        columnNumber: 17\n      }, this), portalElement);\n    }\n  } else {\n    return /*#__PURE__*/_jsxDEV(_Fragment, {}, void 0, false);\n  }\n};\n_c = Modal;\nexport default Modal;\nvar _c;\n$RefreshReg$(_c, \"Modal\");","map":{"version":3,"names":["React","ReactDOM","Button","Modal","active","title","hasFunctionButtons","onSubmit","onClose","children","portalElement","document","getElementById","createPortal","event","stopPropagation"],"sources":["/data/messenger.client/src/components/Modal/index.tsx"],"sourcesContent":["import React from 'react';\nimport ReactDOM from \"react-dom\";\nimport {IModalProps} from \"../../models/props/IModalProps\";\nimport \"./Modal.scss\";\nimport {Button} from \"../index\";\n\nconst Modal: React.FC <React.PropsWithChildren<IModalProps>> = ({active, title, hasFunctionButtons = false, onSubmit, onClose, children}) => {\n    if (active) {\n        const portalElement = document.getElementById('root');\n        if (portalElement) {\n            return ReactDOM.createPortal(\n                <div className=\"modal\" onClick={onClose}>\n                    <div className=\"modal__content\" onClick={event => event.stopPropagation()}>\n                        <div className=\"modal__header\">\n                            <div className=\"modal__title\">{title}</div>\n                        </div>\n                        <div className=\"modal__body\">{children}</div>\n                        {(hasFunctionButtons &&\n                            <div className=\"modal__footer\">\n                                <Button\n                                    fullWidth={false}\n                                    text={'Отмена'}\n                                    customClassName={\"modal__button\"}\n                                    callback={onClose}\n                                />\n                                <Button fullWidth={false} text={'Подтвердить'} customClassName={\"modal__button\"} />\n                            </div>\n                        )}\n                    </div>\n                </div>,\n                portalElement\n            );\n        }\n    } else {\n        return (<></>);\n    }\n}\n\nexport default Modal;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,QAAQ,MAAM,WAAW;AAEhC,OAAO,cAAc;AACr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